Skip to content

feat(api)!: model CPU and memory as typed compute resource requirements - #3012

Draft
elezar wants to merge 7 commits into
mainfrom
feat/2838-portable-compute-requirements/elezar
Draft

feat(api)!: model CPU and memory as typed compute resource requirements#3012
elezar wants to merge 7 commits into
mainfrom
feat/2838-portable-compute-requirements/elezar

Conversation

@elezar

@elezar elezar commented Aug 28, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds typed CPU and memory requirements to the public and compute-driver ResourceRequirements messages.
  • Uses the same public ResourceRequirements message for inline sandbox specs and reusable SandboxWorkloadConfig.resources (field 3), removing the duplicate SandboxResources and template-only GPU SDK types.
  • Keeps the historical inline SandboxTemplate.resources field as platform-native passthrough and rejects legacy CPU/memory entries there with migration guidance.
  • Updates the CLI, gateway resolution, built-in drivers, Rust/Go/Python/TypeScript SDKs, generated bindings, tests, examples, and documentation.

Related Issue

Part of #2838.

Changes

  • proto/openshell.proto: models portable CPU, memory, and GPU requirements once under ResourceRequirements; reusable workload templates reuse that message without renaming or renumbering their resources field.
  • proto/compute_driver.proto: carries the corresponding typed requirements at the existing driver sandbox-spec boundary; no additional driver template message was added.
  • CLI and Python template builders populate cpu.limit and memory.limit; Rust and TypeScript expose the same shared shape.
  • Gateway template resolution clones typed resource requirements directly into the persisted sandbox spec.
  • Kubernetes, Docker, and Podman consume typed CPU/memory requirements. VM and MXC reject unsupported typed CPU/memory requirements explicitly.
  • Go SDK template types and converters reuse ResourceRequirements; generated Go protobuf bindings were regenerated. TypeScript and Python generated bindings remain build outputs regenerated by their build tasks.
  • Documentation distinguishes portable ResourceRequirements from the historical inline platform-native SandboxTemplate.resources passthrough.

Compatibility

This is an intentional breaking API change. Existing reusable-template clients using the removed SandboxResources wire shape must regenerate bindings and send ResourceRequirements (cpu.limit, memory.limit, and gpu). The outer SandboxWorkloadConfig.resources field name and field number remain unchanged.

The SDK impact is recorded in language-specific breaking commits, ordered Rust, Go, Python, then TypeScript:

  • Rust removes the SandboxResources alias and exposes typed CPU and memory requirements.
  • Go changes SandboxWorkloadConfig.Resources to ResourceRequirements and removes template-only resource types.
  • Python preserves the high-level builder arguments, but raw protobuf callers must use the new nested fields.
  • TypeScript removes the curated SandboxResources export and uses the shared generated type.

Testing

  • Focused Rust tests: cargo test -p openshell-server -p openshell-cli -p openshell-sdk
  • Go SDK full CI: mise run go:ci
  • TypeScript SDK full CI: mise run sdk:ts:ci (105 tests)
  • Python tests: mise run test:python (152 tests)
  • Python lint and type checking
  • Repository pre-commit: mise run pre-commit

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Unit and integration tests updated
  • SDK bindings and examples updated
  • Published and architecture documentation updated

@copy-pr-bot

copy-pr-bot Bot commented Aug 28, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@elezar elezar added this to the OpenShell 0.1.0 milestone Aug 28, 2026
@elezar

elezar commented Aug 28, 2026

Copy link
Copy Markdown
Member Author

/ok-to-test cd3f905

@elezar
elezar force-pushed the feat/2838-portable-compute-requirements/elezar branch 2 times, most recently from f3e21a8 to 18df2b1 Compare September 1, 2026 09:18
@elezar
elezar force-pushed the feat/2838-portable-compute-requirements/elezar branch from 18df2b1 to 449d763 Compare September 8, 2026 13:39
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

@elezar
elezar force-pushed the feat/2838-portable-compute-requirements/elezar branch 2 times, most recently from 5bd00ad to beaa621 Compare September 9, 2026 09:38
Model CPU, memory, and GPU through one typed ResourceRequirements envelope across inline sandbox specs, reusable workload templates, and compute drivers. Update the CLI, gateway translation, and built-in drivers to consume the unified model.

BREAKING CHANGE: CPU and memory move to typed resource requirements, and SandboxWorkloadConfig.resources now uses ResourceRequirements instead of SandboxResources.

Part of #2838

Signed-off-by: Evan Lezar <elezar@nvidia.com>
Expose the shared typed ResourceRequirements model for inline and reusable-template workloads and remove the template-only SandboxResources alias.

BREAKING CHANGE: SandboxResources is removed; reusable workload templates now use ResourceRequirements with typed CPU and memory fields.

Part of #2838

Signed-off-by: Evan Lezar <elezar@nvidia.com>
Use ResourceRequirements for both inline and reusable-template sandbox workloads, update deep-copy converters and fakes, and regenerate the Go protobuf binding.

BREAKING CHANGE: SandboxWorkloadConfig.Resources now uses ResourceRequirements, and the template-only SandboxResources and SandboxGPURequirements types are removed.

Part of #2838

Signed-off-by: Evan Lezar <elezar@nvidia.com>
Update reusable workload template construction and tests for the shared ResourceRequirements protobuf shape while preserving the high-level builder arguments.

BREAKING CHANGE: Raw reusable-template protobuf callers must use resources.cpu.limit and resources.memory.limit instead of string fields.

Part of #2838

Signed-off-by: Evan Lezar <elezar@nvidia.com>
Use the shared generated ResourceRequirements shape for reusable workload templates and update the curated exports and tests.

BREAKING CHANGE: SandboxResources is no longer exported, and reusable-template CPU and memory values use typed limit objects.

Part of #2838

Signed-off-by: Evan Lezar <elezar@nvidia.com>
Validate typed CPU and memory quantities and reject legacy CPU or memory entries in the historical inline template resource passthrough with migration guidance.

Part of #2838

Signed-off-by: Evan Lezar <elezar@nvidia.com>
Document the shared inline and reusable-template resource model, driver behavior, migration from legacy template resource sections, and updated SDK examples.

Part of #2838

Signed-off-by: Evan Lezar <elezar@nvidia.com>
@elezar
elezar force-pushed the feat/2838-portable-compute-requirements/elezar branch from beaa621 to 90eb97b Compare September 9, 2026 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant